import {Link} from "react-router-dom";

export class BreadcrumbUtils {

    static itemRender(route: any, params: any, routes: any, paths: any) {
        const last = routes.indexOf(route) === routes.length - 1;
        return (last || !route.path) ? (
            <span>{route.breadcrumbName}</span>
        ) : (
            <Link to={paths.join('/')}>{route.breadcrumbName}</Link>
        );
    }

}
